<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:fn="http://java.sun.com/jsp/jstl/functions"
	xmlns:p="http://primefaces.org/ui"
	xmlns:cc="http://java.sun.com/jsf/composite"
	xmlns:hmrList="http://java.sun.com/jsf/composite/list"
	xmlns:hmrDetail="http://java.sun.com/jsf/composite/detail"	>

<cc:interface>
	<cc:attribute name="handler"	type="com.hemerasolutions.v2trainer.component.interfaces.detail.TrainingSystemDetailsCompInterface" required="true"/>
</cc:interface>

<cc:implementation>
	<span id="#{cc.clientId}" >
		<p:tabView id="tabTrainingSystem" dynamic="true" style="border:none;height:98%" rendered="#{cc.attrs.handler.trainingSystem != null}"  >
			<p:tab id="tabTrainingSystemData"  title="#{msgs.BasicData}" titleStyleClass="ui-widget">
				<p:outputPanel id="formTrainingSystemData" layout="block" style="height:100%" >
					<h:panelGrid columns="2" cellpadding="2" columnClasses="top-align,top-align" style="min-height:90%;width:100%"  > 
						<h:column>
							<h:panelGrid columns="2" cellpadding="2" > 
					            <h:outputLabel value="#{msgs.Name} :" for="trainingSystemName" />
					            <p:inputText id="trainingSystemName"     value="#{cc.attrs.handler.trainingSystem.name}" disabled="true"
					            	maxlength ="20" size="20" required="true" requiredMessage="#{msgs.TrainingSystemNameObligatory}" />
					
				
								<h:outputLabel value="#{msgs.Description} :" for="trainingSystemDescription" />
								<p:inputTextarea id="trainingSystemDescription" rows="4" cols="50"
									maxlength="180" disabled="true" autoResize="false"
									value="#{ cc.attrs.handler.trainingSystem.description}" />
			
								<h:outputLabel value="#{msgs.Obs} :" for="trainingSystemObs" />
								<p:inputTextarea id="trainingSystemObs" rows="4" cols="50"
									maxlength="180"	disabled="true" autoResize="false"
									value="#{ cc.attrs.handler.trainingSystem.obs}" />
			
								<h:outputLabel 	value="#{msgs.Library} :"		for="trainingSystemSavedLibrary" />
								<p:inputText id="trainingSystemSavedLibrary" value="#{cc.attrs.handler.trainingSystem.library.name}"  disabled="true"  />
													
								<h:outputLabel 	value="#{msgs.CreatedAt} :"		for="trainingSystemCreatedAt"  />
								<p:inputText  	id="trainingSystemCreatedAt" 	value="#{cc.attrs.handler.trainingSystem.createdAt}" disabled="true"  >
									<f:convertDateTime locale="pt" dateStyle="long" pattern="dd/MM/yyyy HH:mm"  />
								</p:inputText>
					
								<h:outputLabel 	value="#{msgs.ChangedAt} :"		for="trainingSystemChangedAt"  />
								<p:inputText  	id="trainingSystemChangedAt" 	value="#{cc.attrs.handler.trainingSystem.lastChange}" disabled="true" >
									<f:convertDateTime locale="pt" dateStyle="long" pattern="dd/MM/yyyy HH:mm" />  
								</p:inputText>
							</h:panelGrid>			
						</h:column>
					</h:panelGrid>		
				</p:outputPanel>
			</p:tab >
			<p:tab id="tabExercises"    title="#{msgs.Exercises}" titleStyleClass="ui-widget">
				<p:outputPanel id="tsStepsPanel" layout="block" style="height:90%">
					<hmrList:stepListLevelsComp handler="#{cc.attrs.handler.levelsHandler}"  enabled="false"  importSteps="false"/>
				</p:outputPanel>
			</p:tab>
		</p:tabView>
	</span>

</cc:implementation>
</html>	